/**
 * Copyright © 2020 易久批信息技术有限公司. All rights reserved.
 */
package com.dysm.iterator;

/**
 * 迭代器模式
 * @author xiay
 * @since 2020/12/13 9:39 下午
 */
public class IteratorClient {

    public static void main(String[] args) {
        MyList myList = new MyList();
        myList.add("234");
        myList.add(345345);

        MyIterator iterator = myList.iterator();
        while (iterator.hasNext()) {
            Object current = iterator.getCurrent();
            System.out.println(current);
            iterator.next();
        }
    }
}
